package com.liuym.classes.service;

import com.liuym.classes.repository.model.bo.ClassScoreBO;
import com.liuym.common.exception.ClassException;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
 * @author Liuym
 * @date 2019/1/3 15:15
 * @describe：
 */
public interface ClassScoreService {
    /**
     * 更新
     * @param classScoreTableName
     * @param classScoreBO
     * @throws ClassException
     */
    void updateClassScore(String classScoreTableName, ClassScoreBO classScoreBO,Integer oldScore) throws ClassException;


    /**
     * 添加班级分数，单个
     *
     * @param classScoreTableName
     * @param classScoreBO
     * @throws ClassException
     */
    boolean addClassScore(String classScoreTableName, String userName, ClassScoreBO classScoreBO) throws ClassException;

    /**
     * 添加分数 批量
     *
     * @param userName
     * @param classScoreBOList
     * @return
     * @throws ClassException
     */
    Map<String, Object> addClassScoreBatch(
            String classScoreTableName, String userName, List<ClassScoreBO> classScoreBOList)
            throws ClassException;

    /**
     * 根据班号获取班级分数列表
     *
     * @param classScoreTableName
     * @param classNumber
     * @return
     * @throws ClassException
     */
    List<ClassScoreBO> getClassScoreByNumber(String classScoreTableName, long classNumber) throws ClassException;

    /**
     * 根据id获得班级分数
     *
     * @param classScoreTableName
     * @param id
     * @return
     * @throws ClassException
     */
    ClassScoreBO getClassScoreById(String classScoreTableName, int id) throws ClassException;


    /**
     * 删除
     *
     * @param classScoreTableName
     * @param id
     * @throws ClassException
     */
    void deleteClassScore(String classScoreTableName, int id) throws ClassException;

    /**
     * 删除
     *
     * @param classScoreTableName
     * @param classNumber
     * @throws ClassException
     */
    void deleteClassScoreByNumber(String classScoreTableName, long classNumber) throws ClassException;

    /**
     * 根据时间段获得全部
     *
     * @param classScoreTableName
     * @param startTime
     * @param endTime
     * @return
     * @throws ClassException
     */
    List<ClassScoreBO> getClassScoreByTime(String classScoreTableName, Date startTime, Date endTime) throws ClassException;

    /**
     * 根据管理员和时间段获取全部
     *
     * @param classScoreTableName
     * @param userName
     * @param startTime
     * @param endTime
     * @return
     * @throws ClassException
     */
    List<ClassScoreBO> getClassScoreByAdmin(String classScoreTableName, String userName, Date startTime, Date endTime) throws ClassException;

    /**
     * 新建班级分数表
     *
     * @return
     */
    int addClassScoreTable(String studentScoreTableName) throws ClassException;
}
